from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps
from conan.tools.env import VirtualBuildEnv
from conan.tools.files import get
from conan.tools.scm import Git
from conan.tools.files import copy
from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir

class MyProjectConan(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    name = "websocketserver"
    version = "0.0.1"
    homepage = "https://gitee.com/xuxudong/websocketdemo.git"
    exports_sources = "CMakeLists.txt", "src/*", "cmake/*","example/*"

    def requirements(self):
        self.requires("websocketpp/0.8.2")

    def layout(self):
        cmake_layout(self)

    def generate(self):
        tc = VirtualBuildEnv(self)
        tc.generate()
        tc = CMakeToolchain(self)
        tc.generate()
        deps = CMakeDeps(self)
        deps.generate()

    def build(self):
        cmake = CMake(self)
        cmake.configure()
        cmake.build()

    def package(self):
        cmake = CMake(self)
        cmake.install()

    def package_info(self):
        self.cpp_info.libs = ["websocketserver"]
        self.cpp_info.includedirs = ["include"]
